<?php

/**
 * tblOrders form base class.
 *
 * @method tblOrders getObject() Returns the current form's model object
 *
 * @package    travis
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasetblOrdersForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'user_id'            => new sfWidgetFormInputText(),
      'provider_id'        => new sfWidgetFormInputText(),
      'provider_order'     => new sfWidgetFormInputText(),
      'main_first_name'    => new sfWidgetFormInputText(),
      'main_last_name'     => new sfWidgetFormInputText(),
      'from_date'          => new sfWidgetFormDate(),
      'to_date'            => new sfWidgetFormDate(),
      'hotel_id'           => new sfWidgetFormInputText(),
      'rooms_id'           => new sfWidgetFormInputText(),
      'guest_names'        => new sfWidgetFormInputText(),
      'children'           => new sfWidgetFormInputCheckbox(),
      'children_names'     => new sfWidgetFormInputText(),
      'children_ages'      => new sfWidgetFormInputText(),
      'type_price'         => new sfWidgetFormInputText(),
      'payment_type'       => new sfWidgetFormInputText(),
      'amount'             => new sfWidgetFormInputText(),
      'commissions'        => new sfWidgetFormInputText(),
      'status'             => new sfWidgetFormInputText(),
      'cancellation'       => new sfWidgetFormInputCheckbox(),
      'cancellation_date'  => new sfWidgetFormDate(),
      'agent_cancellation' => new sfWidgetFormDate(),
      'create_by'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'user_id'            => new sfValidatorInteger(array('required' => false)),
      'provider_id'        => new sfValidatorInteger(array('required' => false)),
      'provider_order'     => new sfValidatorPass(array('required' => false)),
      'main_first_name'    => new sfValidatorPass(array('required' => false)),
      'main_last_name'     => new sfValidatorPass(array('required' => false)),
      'from_date'          => new sfValidatorDate(array('required' => false)),
      'to_date'            => new sfValidatorDate(array('required' => false)),
      'hotel_id'           => new sfValidatorInteger(array('required' => false)),
      'rooms_id'           => new sfValidatorPass(array('required' => false)),
      'guest_names'        => new sfValidatorPass(array('required' => false)),
      'children'           => new sfValidatorBoolean(array('required' => false)),
      'children_names'     => new sfValidatorPass(array('required' => false)),
      'children_ages'      => new sfValidatorPass(array('required' => false)),
      'type_price'         => new sfValidatorInteger(array('required' => false)),
      'payment_type'       => new sfValidatorInteger(array('required' => false)),
      'amount'             => new sfValidatorPass(array('required' => false)),
      'commissions'        => new sfValidatorPass(array('required' => false)),
      'status'             => new sfValidatorInteger(array('required' => false)),
      'cancellation'       => new sfValidatorBoolean(array('required' => false)),
      'cancellation_date'  => new sfValidatorDate(array('required' => false)),
      'agent_cancellation' => new sfValidatorDate(array('required' => false)),
      'create_by'          => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('tbl_orders[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'tblOrders';
  }

}
